package com.surfilter.risk.controller;

import com.surfilter.risk.utils.FileWriteUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.ResourceBundle;

/**
 * GeeController
 * Created by Grom on 2017/6/7.
 */
@Controller
@RequestMapping("/gee") //url:/模块/资源/{id}/细分
public class GeeController {
    private final Logger logger= LoggerFactory.getLogger(this.getClass());
    private static String destPath = ResourceBundle.getBundle("system-config").getString("dest_path");
    private static String fileName = ResourceBundle.getBundle("system-config").getString("file_name");
    @RequestMapping(value="/data",method = RequestMethod.GET)
    public String list(String jsonData){
        try {
            FileWriteUtils.writeToFileByLine(jsonData, destPath, fileName);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
